﻿<script type='text/javascript'>
    $(document).ready(function () {
        $('#CarBrand').change(function () {

            var brandString = $('#CarBrand').val();
            $.ajax({
                url: "/Search/BrandUpdateType",
                datatype: "html",
                type: 'GET',
                traditional: true,
                data:
                          {
                              'brand': brandString
                          },
                success: function (result) {
                    $('#divBrandType').html(result);

                    $('#BrandType').change(function () {
                        var typeString = $('#BrandType').val();
                        var brandString = $('#CarBrand').val();
                        $.ajax({
                            url: "/Search/TypeUpdateStyle",
                            datatype: "html",
                            type: 'GET',
                            traditional: true,
                            data:
                          {
                              'brand': brandString,
                              'type': typeString

                          },
                            success: function (result) {
                                $('#divVehicleStyle').html(result);
                            }
                        });

                    });
                }
            });

            $.ajax({
                url: "/Search/BrandUpdateStyle",
                datatype: "html",
                type: 'GET',
                traditional: true,
                data:
                          {
                              'style': ""
                          },
                success: function (result) {
                    $('#divVehicleStyle').html(result);
                }
            });
        });
    });
</script>
 @Html.DropDownList("CarBrand", "请选择品牌")